function oModel = model_calstat(iModel,feedback)
% Calculate statistical information once a measurement is available based on 
% MODEL and FEEDBACK, e.g. meanR2, meanM2. Also update h, rho, meanAlpha2, 
% meanBeta2 in STATE.

oModel = iModel;

oModel.h           = feedback.h;
oModel.rho         = feedback.rho;
oModel.meanAlpha2  = (feedback.alpha).^2;
oModel.meanBeta2   = (feedback.beta).^2;
oModel.meanR2      = model_CalMeanR2(oModel);
oModel.meanM2      = model_CalMeanM2(oModel);

oModel.varAlpha2   = iModel.varAlpha2;
oModel.varBeta2    = iModel.varBeta2;
oModel.varR2       = sum(oModel.varAlpha2+oModel.varBeta2)/(4*pi^2);   % Only predicted varR2 is saved
